exports.install = function(Vue, options) {
	let isConnect = false;
	const print = uni.requireNativePlugin('Sunmi-Print-Inner');
	print.connect(res => {
		console.log(res)
		isConnect = res.connect == "hello"
		Vue.prototype.$isConnect = isConnect;
	})
	Vue.prototype.$printFn = function(list, type) {
		// 0:纯文字一行  1: 纯文字多行  2: 实线  3:虚线  4:空白  5:一维码  6: 二维码  7: 图片
		if (!isConnect) return
		list.forEach(item => {
			if (item.type === 0) {
				print.printText(item)
			} else if (item.type === 1) {
				print.printColumnsText(item)
			} else if (item.type === 2) {
				print.printDividingline({
					style: "0",
					height: "2"
				})
			} else if (item.type === 3) {
				print.printDividingline({
					style: "2",
					height: "2"
				})
			} else if (item.type === 4) {
				print.printDividingline({
					style: "4",
					height: item.height
				})
			} else if (item.type === 5) {
				print.printBarCode(item)
			} else if (item.type === 6) {
				print.printQrCode(item)
			} else if (item.type === 7) {
				print.printBitmap({
					url: item.url,
					align: 1
				})
			}
		})
		print.printDividingline({
			style: "4",
			height: type ? "0" : '120'
		})
	}
}